using System;
using System.Collections.Generic;
using NHibernate.Search.Attributes;
using NHibernate.Search;

namespace Ic.Model
{
	#region BandWork

	/// <summary>
	/// BandWork object for NHibernate mapped table 'TB_BandWorks'.
	/// </summary>
	[Serializable]
	[TableInfo(TableName = "TB_BandWorks", PrimaryKey = "Id" , Columns="Id,BandId,WorkTitle,WorkUrl,WorkDesc,RegDate,Idx")]
	[Indexed(Index = "BandWork")] 
	public class BandWork
	{
		#region Member Variables
		
		protected int _id;
		protected int _bandId;
		protected string _workTitle;
		protected string _workUrl;
		protected string _workDesc;
		protected DateTime _regDate;
		protected int _idx;

		#endregion

		#region Constructors

		public BandWork() { }

		public BandWork( int bandId, string workTitle, string workUrl, string workDesc, DateTime regDate, int idx )
		{
			this._bandId = bandId;
			this._workTitle = workTitle;
			this._workUrl = workUrl;
			this._workDesc = workDesc;
			this._regDate = regDate;
			this._idx = idx;
		}

		#endregion

		#region Public Properties

		[DocumentId]
		public virtual int Id
		{
			get {return _id;}
			set {_id = value;}
		}

		public virtual int BandId
		{
			get { return _bandId; }
			set { _bandId = value; }
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string WorkTitle
		{
			get { return _workTitle; }
			set
			{
				if ( value != null && value.Length > 50)
					throw new ArgumentOutOfRangeException("Invalid value for WorkTitle", value, value.ToString());
				_workTitle = value;
			}
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string WorkUrl
		{
			get { return _workUrl; }
			set
			{
				if ( value != null && value.Length > 200)
					throw new ArgumentOutOfRangeException("Invalid value for WorkUrl", value, value.ToString());
				_workUrl = value;
			}
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string WorkDesc
		{
			get { return _workDesc; }
			set
			{
				_workDesc = value;
			}
		}

		public virtual DateTime RegDate
		{
			get { return _regDate; }
			set { _regDate = value; }
		}

		public virtual int Idx
		{
			get { return _idx; }
			set { _idx = value; }
		}

		

		#endregion
	}
	#endregion
}